#ifndef _LED_DRIVER_H_
#define _LED_DRIVER_H_

//声明枚举，有多少个物理LED，就有多少个编号
typedef enum
{
    LED_ID_1 = 0,
    LED_ID_2,
    LED_ID_3,
    LED_ID_4,

    LED_MAX_NUM,
}led_id_t;

//声明一个颜色值结构体，用来存放每个灯珠的颜色值
typedef struct rgbcw
{
    unsigned char red;    
    unsigned char green;
    unsigned char blue;
    unsigned char cold_w;    //冷白光
    unsigned char white;    //基础白光
}rgbcw_t;

//声明一个LED驱动抽象接口结构体
typedef struct led_driver
{
    unsigned int led_count;    //硬件对应的LED总数
    
    int (*init)(void *_this);
    int (*turn_on)(void *_this, led_id_t id);
    int (*turn_off)(void *_this, led_id_t id);
    int (*set_brightness)(void *_this, led_id_t id, unsigned char brightness);
    int (*set_color)(void *_this, led_id_t id, rgbcw_t *color);
    int (*toggle)(void *_this, led_id_t id);
}led_driver_t;


#endif


